
//
//  HYLeftViewController.m
//  HYCustomCamera
//
//  Created by 上官惠阳 on 2016/12/19.
//  Copyright © 2016年 上官惠阳. All rights reserved.
//

#import "HYLeftViewController.h"

@interface HYLeftViewController ()
- (IBAction)lastAction:(id)sender;

@end

@implementation HYLeftViewController
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor redColor];

    [self loadData];
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    [self.navigationController setNavigationBarHidden:YES animated:YES];
}
- (void)loadData
{
    [self.dataArray addObjectsFromArray:@[@"",@"",@"",@"",@"",@"",@"",@"",@"",@"",@""]];

    [self HY_reloadData];
}
#pragma mark - UITableViewDelegate
/** 分组数量*/
- (NSInteger)HY_numberOfSections
{
    return 1;
}

/** 某个分组的cell数量*/
- (NSInteger)HY_numberOfRowsInSection:(NSInteger)section
{
    return self.dataArray.count;
}
- (CGFloat)HY_cellheightAtIndexPath:(NSIndexPath *)indexPath
{
    return 65;
}
/** 某行的cell*/
- (HYBaseTableViewCell *)HY_cellAtIndexPath:(NSIndexPath *)indexPath
{
    HYBaseTableViewCell *cell = [HYBaseTableViewCell cellWithTableView:self.tableView];

    return cell;
}
-(NSArray *)tableView:(UITableView *)tableView editActionsForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewRowAction *deleteRoWAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleDestructive title:@"删除" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {//title可自已定义
        NSLog(@"点击删除");
    }];//此处是iOS8.0以后苹果最新推出的api，UITableViewRowAction，Style是划出的标签颜色等状态的定义，这里也可自行定义

    UITableViewRowAction *editRowAction = [UITableViewRowAction rowActionWithStyle:UITableViewRowActionStyleNormal title:@"编辑" handler:^(UITableViewRowAction *action, NSIndexPath *indexPath) {

    }];
    editRowAction.backgroundColor = [UIColor colorWithRed:0 green:124/255.0 blue:223/255.0 alpha:1];//可以定义RowAction的颜色
    return @[deleteRoWAction, editRowAction];//最后返回这俩个RowAction 的数组
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/
- (IBAction)lastAction:(id)sender {
    [self dismissViewControllerAnimated:YES completion:nil];
}
@end
